package com.xiaoyu.awakening.user.api;

import com.xiaoyu.awakening.common.core.dto.Page;
import com.xiaoyu.awakening.common.core.dto.Result;
import com.xiaoyu.awakening.user.dto.RoleDto;
import com.xiaoyu.awakening.user.dto.req.CreateRoleReq;
import com.xiaoyu.awakening.user.dto.req.SearchUserReq;
import com.xiaoyu.awakening.user.dto.req.UpdateRoleReq;
import org.springframework.web.bind.annotation.*;

/**
 * 用户信息管理模块
 *
 * @author wangxiaoyu
 * @date 2024/6/15 23:06
 * @since v1.0
 */
@RequestMapping("/api/v1/role")
public interface IRoleControllerApi {
    @PostMapping(value = "/create")
    Result<RoleDto> create(@RequestBody CreateRoleReq createRoReq);

    @DeleteMapping(value = "/delete/{id}")
    Result<String> delete(@PathVariable(value = "id") Long id);

    @PostMapping(value = "/update")
    Result<RoleDto> update(@RequestBody UpdateRoleReq updateRoleReq);

    @PostMapping(value = "/search")
    Result<Page<RoleDto>> search(@RequestBody SearchUserReq searchUserReq);

    @GetMapping(value = "/details/{id}")
    Result<RoleDto> details(@PathVariable(value = "id") Long id);
}
